package com.ltg.urban.domain.project.controller;

import com.ltg.framework.util.http.Result;
import com.ltg.urban.domain.project.data.response.StatisticsResp;
import com.ltg.urban.domain.project.data.response.UrbanProjectResp;
import com.ltg.urban.domain.project.entity.UrbanProject;
import com.ltg.urban.domain.project.service.UrbanStatisticsService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p> ClassName: UrbanStatisticsController </p>
 * <p> Package: com.ltg.urban.domain.project.controller </p>
 * <p> Description: </p>
 * <p></p>
 *
 * @Author: LTG
 * @Create: 2023/3/6 - 21:52
 * @Version: v1.0
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1/urban/statistics")
@Tag(name = "统计模块")
public class UrbanStatisticsController {
    private final UrbanStatisticsService urbanStatisticsService;

    @GetMapping("/counts")
    @Operation(summary = "统计")
    public Result<List<Integer>> statistics() {
        return urbanStatisticsService.statistics();
    }

    @GetMapping("/list")
    @Operation(summary = "首页列表")
    public Result<List<UrbanProjectResp>> list() {
        return urbanStatisticsService.indexList();
    }
}
